/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jpa.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author julio
 */
@Entity
@Table(name = "frequences", catalog = "transit", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Frequences.findAll", query = "SELECT f FROM Frequences f"),
    @NamedQuery(name = "Frequences.findByTripId", query = "SELECT f FROM Frequences f WHERE f.tripId = :tripId"),
    @NamedQuery(name = "Frequences.findByStartTime", query = "SELECT f FROM Frequences f WHERE f.startTime = :startTime"),
    @NamedQuery(name = "Frequences.findByEndTime", query = "SELECT f FROM Frequences f WHERE f.endTime = :endTime"),
    @NamedQuery(name = "Frequences.findByHeadwaySecs", query = "SELECT f FROM Frequences f WHERE f.headwaySecs = :headwaySecs")})
public class Frequences implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "trip_id", nullable = false, length = 45)
    private String tripId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 8)
    @Column(name = "start_time", nullable = false, length = 8)
    private String startTime;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 8)
    @Column(name = "end_time", nullable = false, length = 8)
    private String endTime;
    @Basic(optional = false)
    @NotNull
    @Column(name = "headway_secs", nullable = false)
    private int headwaySecs;

    public Frequences() {
    }

    public Frequences(String tripId) {
        this.tripId = tripId;
    }

    public Frequences(String tripId, String startTime, String endTime, int headwaySecs) {
        this.tripId = tripId;
        this.startTime = startTime;
        this.endTime = endTime;
        this.headwaySecs = headwaySecs;
    }

    public String getTripId() {
        return tripId;
    }

    public void setTripId(String tripId) {
        this.tripId = tripId;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public int getHeadwaySecs() {
        return headwaySecs;
    }

    public void setHeadwaySecs(int headwaySecs) {
        this.headwaySecs = headwaySecs;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (tripId != null ? tripId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Frequences)) {
            return false;
        }
        Frequences other = (Frequences) object;
        if ((this.tripId == null && other.tripId != null) || (this.tripId != null && !this.tripId.equals(other.tripId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "jpa.entities.Frequences[ tripId=" + tripId + " ]";
    }
    
}
